<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>object-fit&object-position</title>
    <style>
        h3 {
            text-align: center;
        }

        .box {
            width: 200px;
            height: 200px;
            border: 3px solid red;
        }

        img {
            width: 200px;
            height: 200px;
            object-fit: cover;
            /* 图像缩放以完全覆盖容器，保持长宽比 */
            object-position: 100% 100%;
            /* 图像在容器中居中显示 */
        }
    </style>
</head>

<body>
    <h3>用于控制替换元素（如图像或视频）的内容填充方式和定位。</h3>
    <div class="box">
        <img src="./images/2.jpg" alt="">
    </div>
</body>

</html>